export default {
  name: "reexamine",
  components: {
    resumeDetail: () => import("../../../component/resumeDetail/index.vue"),
    companyDetail: () => import("../../socical/socialCheck/check.vue")
  },
  data() {
    return {
      tableData: [],
      form: {
        companyid: "",
        pagenum: 1,
        pagesize: 10,
        starttime: "",
        endtime: ""
      },
      total: 0,
      companyid: "",
      dialogVisible: false,
      dialogVisible1: false,
      dialogVisible2: false,
      userid: "",
      companyid: "",
      companyname: "",
      nickName: ""
    }
  },
  created() {
    this.getTableData();
  },
  methods: {
    // 时间比较
    compareDate() {
      let starttime = Date.parse(this.form.starttime);
      let endtime = Date.parse(this.form.endtime);
      if (starttime > endtime) {
        this.$message({
          message: '开始时间不能大于结束时间',
          type: 'error'
        });
        return false;
      } else {
        return true;
      }
    },
    getTableData() {
      if (!this.compareDate()) {
        return
      } else {
        this.loading = true;
        this.$axios.post("/app/v1/platform/abnormal/reexamineExceptionList", this.form).then(res => {
          this.loading = false;
          if (res.data.code === 1) {
            this.tableData = res.data.data.list;
            this.total = +res.data.data.totalnum;
          } else {
            this.$message({
              message: res.data.message,
              type: "error"
            });
          }
        });
      }
    },
    query() {
      this.form.pagenum = 1;
      this.getTableData();
    },
    // 分页
    handleCurrentChange(val) {
      this.form.pagenum = val;
      this.getTableData();
    },
    handleSizeChange(val) {
      this.form.pagenum = 1;
      this.form.pagesize = val;
      this.getTableData();
    },
    // handleClickDetails(row) {
    //   this.companyid = row.companyid;
    //   this.dialogVisible = true;
    // },
    // 查看会员详情
    handleClickNickName(row) {
      this.userid = row.userid;
      this.nickName = row.nickname;
      this.dialogVisible1 = true;
    },
    // 查看公司详情
    handleClickCompanyName(row) {
      this.companyid = row.companyid;
      this.companyname = row.companyname;
      this.dialogVisible2 = true;
    }
  }
}